# Creating a new Resource Requests

This endpoint returns structured Resource Requests objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array
and will be indexed by ID in the `resource_requests` top-level JSON key.
Please see our [Response Format](#section/Response-Format) section for more information.

Endpoint: POST /resource_requests
Version: 1.0.0

## Query parameters:

  - `include` (string)
    Any of the below associations can be included in your request by providing the `include` param, e.g. `include=association1,association2`.
- `approvers` (User) - The users available to approver or reject the resource request.
- `creator` (User) - The person submitting the resource request.
- `resource` (WorkspaceResource) - The resource the request is intending to assign a user to.

## Request fields (application/json):

  - `resource_request` (object)

  - `resource_request.resource_id` (integer)
    The ID of the resource for which the resource request will be created.

  - `resource_request.resource_workspace_id` (integer)
    A resource will be created for this project in addition to the resource request.

  - `resource_request.resource_role_id` (integer)
    A resource will be created with this role in addition to the resource request.

  - `resource_request.approver_ids` (array, required)
    The IDs of the people selected to approve this request.

  - `resource_request.workspace_allocation_start_date` (string)
    Set the allocation start date for a created workspace resource. The date must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `resource_request.workspace_allocation_end_date` (string)
    Set the allocation start date for a created workspace resource. The date must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `resource_request.workspace_allocation_percentage` (integer)
    Set the allocation percentage for a created workspace resource.

  - `resource_request.custom_fields` (array)
    Determines the custom field values for the workspace resource.

  - `resource_request.custom_fields.custom_field_id` (integer)
    The ID of the custom field.

  - `resource_request.custom_fields.value` (string)
    The value for the corresponding custom field. The value formats for different types are:

* `string` - `<text_string>`, eg. `'foo'`
* `date` - `<ISO_8601 Date Format>` eg. `'2014-02-25'` `(accepted range: '1900-01-01' to '2015-12-31')`
* `number` - `<integer_value>` eg. `'13'`
* `currency` - `[<int_value_in_cents>, <currency_code>]` eg. `'[998, USD]'`
* `single` and `multi` - `[<choice_ids>]` eg. `'[1, 2, 4]'`.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 403 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 404 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 422 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 503 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

